package com.cetc39.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_node")
public class Node {
	private int id;
	private FirstPlan firstplan;
	private String node_id;
	private Department department;
	private String node_number;
	private int node_lifecycle;
	private LifeCycle lc;
	private int node_exam;
	private int node_milestone;
	private int node_level;
	private Date node_settime;
	private Date node_lasttime;
	private String node_version;
	private Date node_starttime;
	private Date node_endtime;
	private int node_workdays;
	private String node_workdetails;
	private String node_result;
	private String node_describe;
	private String node_remark;
	private int status;
	private int updateornot;
	private NodeSource nodeSource; 
	private String nodeFileSource;
	private NodeType nodeType;
	private Node last;
	private Node next;
	private Node relatedNode;
	private Set<NodeCheckRecord> nodeCheckRecords = new HashSet<NodeCheckRecord>(0); 
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@ManyToOne
	public FirstPlan getFirstplan() {
		return firstplan;
	}
	public void setFirstplan(FirstPlan firstplan) {
		this.firstplan = firstplan;
	}
	
	public String getNode_id() {
		return node_id;
	}
	public void setNode_id(String node_id) {
		this.node_id = node_id;
	}
	@ManyToOne
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	public String getNode_number() {
		return node_number;
	}
	public void setNode_number(String node_number) {
		this.node_number = node_number;
	}
	public int getNode_lifecycle() {
		return node_lifecycle;
	}
	public void setNode_lifecycle(int node_lifecycle) {
		this.node_lifecycle = node_lifecycle;
	}
	public int getNode_exam() {
		return node_exam;
	}
	public void setNode_exam(int node_exam) {
		this.node_exam = node_exam;
	}
	public int getNode_milestone() {
		return node_milestone;
	}
	public void setNode_milestone(int node_milestone) {
		this.node_milestone = node_milestone;
	}
	public int getNode_level() {
		return node_level;
	}
	public void setNode_level(int node_level) {
		this.node_level = node_level;
	}
	public Date getNode_settime() {
		return node_settime;
	}
	public void setNode_settime(Date node_settime) {
		this.node_settime = node_settime;
	}
	public Date getNode_lasttime() {
		return node_lasttime;
	}
	public void setNode_lasttime(Date node_lasttime) {
		this.node_lasttime = node_lasttime;
	}
	public String getNode_version() {
		return node_version;
	}
	public void setNode_version(String node_version) {
		this.node_version = node_version;
	}
	public Date getNode_starttime() {
		return node_starttime;
	}
	public void setNode_starttime(Date node_starttime) {
		this.node_starttime = node_starttime;
	}
	public Date getNode_endtime() {
		return node_endtime;
	}
	public void setNode_endtime(Date node_endtime) {
		this.node_endtime = node_endtime;
	}
	public int getNode_workdays() {
		return node_workdays;
	}
	public void setNode_workdays(int node_workdays) {
		this.node_workdays = node_workdays;
	}
	public String getNode_workdetails() {
		return node_workdetails;
	}
	public void setNode_workdetails(String node_workdetails) {
		this.node_workdetails = node_workdetails;
	}
	public String getNode_result() {
		return node_result;
	}
	public void setNode_result(String node_result) {
		this.node_result = node_result;
	}
	public String getNode_describe() {
		return node_describe;
	}
	public void setNode_describe(String node_describe) {
		this.node_describe = node_describe;
	}
	public String getNode_remark() {
		return node_remark;
	}
	public void setNode_remark(String node_remark) {
		this.node_remark = node_remark;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getUpdateornot() {
		return updateornot;
	}
	public void setUpdateornot(int updateornot) {
		this.updateornot = updateornot;
	}
	
	public String getNodeFileSource() {
		return nodeFileSource;
	}
	public void setNodeFileSource(String nodeFileSource) {
		this.nodeFileSource = nodeFileSource;
	}
	@ManyToOne
	public LifeCycle getLc() {
		return lc;
	}
	public void setLc(LifeCycle lc) {
		this.lc = lc;
	}
	
	/*@ManyToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL)
	@JoinTable(name="t_node_nodesource")
	public Set<NodeSource> getNode_origin() {
		return node_origin;
	}
	public void setNode_origin(Set<NodeSource> node_origin) {
		this.node_origin = node_origin;
	}
	@ManyToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL)
	@JoinTable(name="t_node_nodetype")
	public Set<NodeType> getNode_type() {
		return node_type;
	}
	public void setNode_type(Set<NodeType> node_type) {
		this.node_type = node_type;
	}*/
	
	@ManyToOne
	public NodeSource getNodeSource() {
		return nodeSource;
	}
	public void setNodeSource(NodeSource nodeSource) {
		this.nodeSource = nodeSource;
	}
	@ManyToOne
	public NodeType getNodeType() {
		return nodeType;
	}
	public void setNodeType(NodeType nodeType) {
		this.nodeType = nodeType;
	}

	@OneToOne
	public Node getLast() {
		return last;
	}
	public void setLast(Node last) {
		this.last = last;
	}
	@OneToOne
	public Node getNext() {
		return next;
	}
	public void setNext(Node next) {
		this.next = next;
	}
	@OneToOne
	public Node getRelatedNode() {
		return relatedNode;
	}
	public void setRelatedNode(Node relatedNode) {
		this.relatedNode = relatedNode;
	}
	@OneToMany(fetch=FetchType.EAGER, mappedBy="node")
	public Set<NodeCheckRecord> getNodeCheckRecords() {
		return nodeCheckRecords;
	}
	public void setNodeCheckRecords(Set<NodeCheckRecord> nodeCheckRecords) {
		this.nodeCheckRecords = nodeCheckRecords;
	}
	
	
	
}
